<script setup>
    import { ref } from "vue"
    const isActive = ref(false)
</script>

<template>
    <div>
        <p :class="isActive ? 'emphasize' : ''">
            style
        </p>

        <p :class="{emphasize: isActive, decoration: isActive}">
            style2
        </p>
    </div>
</template>

<style scoped>
    p.emphasize {
        /* 字体强调样式 */
        font-size: 28px;
        font-weight: 600;
        color: red;
    }
    p.decoration {
        /* 字体装饰 */
        text-decoration: underline;
    }
</style>